/*============================================================================*/
/*                   CONTINENTAL AUTOMOTIVE SYSTEMS                           */
/*============================================================================*/
/*                        OBJECT SPECIFICATION                                */
/*============================================================================*
* name:            HALWipers.h
* version:         1.1
* created_by:      Rodrigo Casados, Lizette Acosta
* date_created:    June 7 2013
*=============================================================================*/
/* DESCRIPTION : Source file to implement main function.                      */
/*============================================================================*/
/* FUNCTION COMMENT : Implements entry point (main function) and other        */
/* application stuff.                                                         */
/*                                                                            */
/*============================================================================*/
/*                               OBJECT HISTORY                               */
/*============================================================================*/
/*  REVISION |   DATE      |                               |      AUTHOR      */
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*  1.1      | 7/June/2013 |                               | Rodrigo Casados */
/* Initial version for the Smart Car Race 2010 contest using Freescale        */
/* Bolero micro.                                                              */
/*============================================================================*/
#ifndef HALWHEEL_H                               /* To avoid double inclusion */
#define HALWHEEL_H

/* Register definitions for selected microcontroller */
#include "MPC5604B_M27V.h"
#include "stdtypedef.h"
#include "sysinit.h"
#include "MALioapi.h"
#include "MALbeMIOS.h"
#include "MALPWM.h"

extern void WIPE_Init(void);
extern void WIPER_SetWipePos(void);
extern T_UWORD test;

void vfn_WiperMode (void);
void vfn_ReadButtons(T_UBYTE * ptr_ButtonID);
void vfn_SpeedModes (T_UBYTE u8_SelectedMode);
void vfn_ModeSelect (void);
void ProcessPotData(T_UWORD *u16_CurrentPosition);
T_UBYTE u8fn_Deboouncer(T_UBYTE * ptr_to_ButtonID);
void WIPER_Speed(T_UBYTE u8_SelectedMode, T_UWORD *ptr_CurrentPosition);


typedef enum
{
	INIT_WIPER,
	UPDATE_WIPER_POSITION	
}E_SM_WIPER;	/* States for Wheel State Machine */

#endif


